<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
	<h:form id="formEdit" prependId="false">
		<div>
			<rich:panel header="#{messages['label.user']}" style="width: 400px; margin: auto;">
				<table style="width: 100%;">
					<tr>
						<td style="width: 25%;"><h:outputText value="#{messages['label.login']}" /> : </td>
						<td style="width: 75%;">
							<h:inputHidden value="#{userBean.id}" />
							<h:inputText id="login" value="#{userBean.login}" size="15" maxlength="45">
								<f:validateLength minimum="3" maximum="45" />
								<rich:validator />
							</h:inputText>
						</td>
					</tr>
					<tr>
						<td><h:outputText value="#{messages['label.name']}" /> : </td>
						<td>
							<h:inputText id="name" value="#{userBean.name}" size="30" maxlength="100">
								<f:validateLength minimum="3" maximum="100" />
								<rich:validator />
							</h:inputText>
						</td>
					</tr>
					<tr>
						<td><h:outputText value="#{messages['label.email']}" /> : </td>
						<td>
							<h:inputText id="email" value="#{userBean.email}" size="30" maxlength="100">
								<f:validateLength minimum="5" maximum="100" />
								<rich:validator />
							</h:inputText>
						</td>
					</tr>
					<tr>
						<td><h:outputText value="#{messages['label.password']}" /> : </td>
						<td>
							<h:inputSecret id="password" value="#{userBean.password}" size="15" maxlength="20">
								<f:validateLength minimum="3" maximum="20" />
								<rich:validator />
							</h:inputSecret>
						</td>
					</tr>
					<tr>
						<td><h:outputText value="#{messages['label.type']}" /> : </td>
						<td>
							<h:selectOneMenu id="type" value="#{userBean.type}">
								<f:selectItem itemLabel="#{messages['label.administrator']}" itemValue="ADMINISTRATOR" />
								<f:selectItem itemLabel="#{messages['label.manager']}" itemValue="MANAGER" />
								<f:selectItem itemLabel="#{messages['label.user']}" itemValue="USER" />
								<rich:validator />
							</h:selectOneMenu>
						</td>
					</tr>
					<tr>
						<td colspan="2" style="text-align: center;">
							<h:commandButton value="#{messages['label.save']}" action="#{userBean.save}" />
							<h:commandButton value="#{messages['label.cancel']}" action="#{userBean.cancel}" immediate="true"/>			
						</td>
					</tr>
				</table>					
			</rich:panel>
		</div>
	</h:form>
</html>